﻿@{
    Style.Include("formdesigner.css");
}
@Display.StylesheetLinks()

<header id="page-title">
    <h1 class="pull-left">@T("Form Designer") <span>manage the detail page layout</span></h1>
</header>

<section id="main-content" style="margin-top: 47px">
    <div class="row-fluid">
        <div id="page-actions" class="clearfix">
            <btn-actions>
                <button type="button" class="btn btn-small" ng-click="exit()">Back</button>
                <button class="btn btn-primary btn-small" data-indi-click="save()">Save</button>
                <button class="btn btn-primary btn-small" data-indi-click="saveAndBack()">Save & Back</button>
                <button class="btn btn-small">Reset</button>
            </btn-actions>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span3">
            <div id="test" style="z-index: 51" class="bs-docs-sidenav">
                <section id="toolboxes" class="widget">
                    <header class="widget-header light">
                        <span class="title">
                            <div class="btn-group" data-toggle="buttons-radio">
                                <a class="btn active" href="#layoutTools" data-toggle="tab">Layout</a>
                                <a class="btn" href="#fieldTools" data-toggle="tab">Fields</a>
                            </div>
                        </span>
                    </header>

                    <div class="toolbar form-toolbar">
                        <form class="form-search">
                            <input type="text" class="span11 search-query" placeholder="Search...">
                            <span class="close" style="padding-top: 5px">&times;</span>
                        </form>
                    </div>
                    <section class="widget-content form-container">
                        <div class="tab-content">
                            <div class="tab-pane active" id="layoutTools">
                                <fd-tools-section section-columns="1" section-columns-width="6:6">100% Section</fd-tools-section>
                                <fd-tools-section section-columns="2" section-columns-width="3:9">25% + 75% Section</fd-tools-section>
                                <fd-tools-section section-columns="2" section-columns-width="4:8">33% + 67% Section</fd-tools-section>
                                <fd-tools-section section-columns="2" section-columns-width="6:6">50% + 50% Section</fd-tools-section>
                                <fd-tools-section section-columns="2" section-columns-width="8:4">67% + 33% Section</fd-tools-section>
                                <fd-tools-section section-columns="2" section-columns-width="9:3">75% + 25% Section</fd-tools-section>
                                <fd-tools-field field-display-name="Blank Space" field-empty></fd-tools-field>
                                <fd-tools-field field-display-name="Text" field-text></fd-tools-field>
                            </div>
                            <div class="tab-pane" id="fieldTools">
                                @{
                                    foreach (var field in Model.Fields) {
                                    @:<fd-tools-field field-display-name="@field.DisplayName" field-name="@field.Name"></fd-tools-field>
                                    }
                                }
                            </div>
                        </div>
                    </section>
                </section>
            </div>
        </div>
        <div class="span9">
            <div id="form-designer">
                <fd-form>
                    @{ Output.Write(Model.Layout); }
                </fd-form>
            </div>
        </div>
    </div>
    @*<fd-field-properties-dialog></fd-field-properties-dialog>*@
    <fd-section-properties-dialog></fd-section-properties-dialog>

    <div id="fieldPropertiesDialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h3 id="myModalLabel">Field Properties</h3>
        </div>
        <div class="modal-body">
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">Exit</button>
            <button class="btn btn-primary">Ok</button>
        </div>
    </div>

    <div id="textPropertiesDialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h3 id="myModalLabel">Text Properties</h3>
        </div>
        <div class="modal-body">
            <form class="form-horizontal">
                <div class="control-group">
                    <label class="control-label">Display Text</label>
                    <div class="controls">
                        <input type="text" ng-model="currentSection.title" />
                    </div>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">Exit</button>
            <button class="btn btn-primary">Ok</button>
        </div>
    </div>
</section>
@foreach (var item in Model.Templates) {
    Output.Write(Display(item));
}